#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

int main()
{
    key_t key=ftok("./",66);
    if(key==-1)
    {
        perror("ftok:");
        exit(EXIT_FAILURE);
    }
    int semid=semget(key,2,IPC_CREAT |0666);
    if(semid==-1)
    {
        perror("semget:"); 
        exit(EXIT_FAILURE);
    }
    unsigned short i[]={0,1};
    semctl(semid,0,SETALL,i);
    
    semctl(semid,0,IPC_RMID,NULL);
    return 0;
}

